import request from '@/utils/request'

/**
 * 配置列表
 * @param params
 */
export const getConfigListsApi = (params: any) => {
  return request.get('/config/config/lists', { params })
}

/**
 * 添加配置
 * @param params
 */
export const addConfigApi = (params: any) => {
  return request.post('/config/config/create', params)
}

/**
 * 删除配置
 * @param id
 */
export const deleteConfigApi = (id: any) => {
  return request.delete(`/config/config/delete/${id}`)
}

/**
 * 更新配置
 * @param params
 */
export const updateConfigApi = (params: any) => {
  return request.put('/config/config/update', params)
}

/**
 * 获取配置详情
 * @param id
 */
export const getConfigDetailApi = (id: any) => {
  return request.get(`/config/config/detail/${id}`)
}

/**
 * 配置数据列表
 * @param params
 */
export const getConfigDataListsApi = (params: any) => {
  return request.get('/config/data/lists', { params })
}

/**
 * 添加配置数据
 * @param params
 */
export const addConfigDataApi = (params: any) => {
  return request.post('/config/data/create', params)
}

/**
 * 删除配置数据
 * @param id
 */
export const deleteConfigDataApi = (id: any) => {
  return request.delete(`/config/data/delete/${id}`)
}

/**
 * 更新配置数据
 * @param params
 */
export const updateConfigDataApi = (params: any) => {
  return request.put('/config/data/update', params)
}

/**
 * 获取配置数据详情
 * @param id
 */
export const getConfigDataDetailApi = (id: any) => {
  return request.get(`/config/data/detail/${id}`)
}

/**
 * 获取配置数据详情
 * @param configId
 */
export const getConfigApi = (configId: any) => {
  return request.get(`/config/data/getConfigDetail/${configId}`)
}
